<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head th:replace="admin/_fragments :: head(~{::title})">
    <meta charset="UTF-8">
    <!--适应移动端-->
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <title>tagsAdd</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css">
    <link rel="stylesheet" href="../../static/lib/editormd/css/editormd.min.css">
    <link rel="stylesheet" href="../../static/css/me.css">
</head>
<body id="bg1">

<!--导航-->
<nav th:replace="admin/_fragments :: menu(3)" class="ui inverted attached segment m-padded-tb-mini fly m-shadow-small">
    <div class="ui container">
        <div class="ui inverted secondary stackable menu">
            <h2 class="ui teal header item">后台Management</h2>
            <a href="#" class="item m-mobile-hide m-item"><i class="home icon"></i>博客</a>
            <a href="#" class="item m-mobile-hide m-item"><i class="idea icon"></i>分类</a>
            <a href="#" class="item m-mobile-hide m-item"><i class="tags icon"></i>标签</a>

            <!--头像-->
            <div class="right m-item m-mobile-hide menu">
                <div class="ui dropdown item">
                    <div class="text"><img class="ui avatar image" src="../../static/img/1.png"> RYX</div>
                    <!--下拉框-->
                    <i class="dropdown icon"></i>
                    <div class="menu">
                        <a href="#" class="item">注销</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <a href="#" class="ui menu toggle  black icon button m-top-right m-mobile-show">
        <i class="sidebar icon"></i>
    </a>

</nav>

<!--二级导航-->
<div class="ui attached menu">
    <div class="ui container">
        <div class="right menu">
            <a href="#" th:href="@{/admin/tags/input}" class="item">新增</a>
            <a href="#" th:href="@{/admin/tags}" class="active teal item">列表</a>
        </div>

    </div>

</div>

<!--中间内容部分-->
<div class="m-container-small m-padded-tb-large">
    <div class="ui container">
        <form action="#" method="post"  th:object="${tag}" th:action="*{id}==null ? @{/admin/tags} : @{/admin/tags/{id}(id=*{id})} "  class="ui form">
            <input type="hidden" name="id" th:value="*{id}">
            <div class=" field">
                <div class="ui left labeled input">
                    <label class="ui teal basic label">名称</label>
                    <input type="text" name="name" placeholder="tagsName" >
                </div>
            </div>

            <div class="ui error message"></div>



            <div class="ui right aligned container">
                <button class="ui orange button" type="button" onclick="window.history.go(-1)">Back</button>

                <button class="ui orange submit button">Submit</button>
            </div>

        </form>

    </div>


</div>

<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>

<!--底部-->
<footer th:replace="admin/_fragments :: footer" class="ui inverted segment vertical m-padded-tb-massive">
    <div class="ui container center aligned">
        <div class="ui  inverted stackable divided grid">
            <div class="three wide column">
                <img src="../../static/img/Qr.jpg" class="ui rounded image" style="width: 110px;">
            </div>
            <div class="three wide column">
                <h4 class="ui inverted header">最新blog</h4>
                <div class="ui inverted link list">
                    <a href="#" class="item ">My story </a>
                    <a href="#" class="item ">My story </a>
                    <a href="#" class="item ">My story </a>
                </div>
            </div>
            <div class="three wide column">
                <h4 class="ui inverted header">最新blog</h4>
                <div class="ui inverted link list">
                    <a href="#" class="item ">My story </a>
                    <a href="#" class="item ">My story </a>
                    <a href="#" class="item ">My story </a>
                </div>
            </div>
            <div class="seven wide column">
                <h4 class="ui inverted header">最新blog</h4>
                <p class="m-text-spaced m-opacity-mini">只要学不死，就往死里学，加油，噢利给！！！</p>
            </div>

        </div>
        <div class="ui inverted section divider"></div>
        <p class="m-text-thin m-text-spaced m-opacity-mini ">Copyright@2020-2021 Swim's Blog Designed by RYX</p>

    </div>
</footer>

<th:block th:replace="admin/_fragments :: script">
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.js"></script>
<script src="../../static/lib/editormd/editormd.min.js"></script>
</th:block>

<script>
    $('.menu.toggle').click(function () {
        $('.m-item').toggleClass('m-mobile-hide');
    });

    $('.ui.dropdown').dropdown({
        on: 'hover'
    });


    $('.ui .form').form({
       fields : {
           name :{
               identifier : 'name',
               rules :[{
                   type:'empty',
                   prompt: 'typesName is required! '
               }]
           }
       }
    });


    //markdown.js
    var contentEditor;

    $(function() {
        contentEditor = editormd("md-content", {
            width   : "100%",
            height  : 640,
            syncScrolling : "single",
            path    : "../../static/lib/editormd/lib/"
        });

        /*
        // or
        testEditor = editormd({
            id      : "test-editormd",
            width   : "90%",
            height  : 640,
            path    : "../lib/"
        });
        */
    });


</script>

</body>
<script>

</script>
</html>